using InfiniteCraft.Services;
using Microsoft.AspNetCore.Mvc;

namespace InfiniteCraft.Controllers;

public class HomeController : Controller
{
    private readonly Recipes _recipes;

    public HomeController(Recipes recipes)
    {
        _recipes = recipes;
    }


    [HttpGet]
    public IActionResult Index()
    {
        var names = _recipes.GetBasicCraftElementNames();
        return View(names);
    }

    [HttpGet]
    public IActionResult TryToCraft(string srcName, string targetName)
    {
        return Ok(_recipes.TryToCraft(srcName, targetName));
    }
}